<template>
	<view class="bg-white p-20">
		<view class="text-2xl u-text-center font-bold">个人中心</view>
		<view>
			<u-avatar :src="this.$store.state.user.user.avatar"></u-avatar>
			<text>欢迎您:{{this.$store.state.user.user.name}}</text>
		</view>
		<view class="flex flex-col mt-30 justify-center">
			<u-button type="success" @click="navigateToMyVoucher" class="my-10 w-full" style="display: inline-block;">
				我的卡券
			</u-button>
			<u-button type="success"  class="my-10 w-full" style="display: inline-block;">
				修改资料
			</u-button>
			
			<u-button type="success"  class="my-10 w-full" style="display: inline-block;">
				绑定微信
			</u-button>
			
			<u-button type="success"  class="my-10 w-full" style="display: inline-block;">
				商户加盟
			</u-button>
			<u-button type="success"   @click="gotoAgreement" class="my-10 w-full" style="display: inline-block;">
				用户协议
			</u-button>
			<u-button type="success" @click="clientlogout" class="my-10 w-full" style="display: inline-block;">
				退出登录
			</u-button>
		</view>
	</view>
</template>

<script>
	import {
		mapActions,
		mapState
	} from 'vuex';
	export default {
		data() {
			return {
				form: {
				
				}
			}
		},
		methods: {
			...mapActions('user', ['logout']),
			async clientlogout() {
				await this.logout()
				const url='/pages/login/index'
				uni.reLaunch({
					url
				})
			},
			navigateToMyVoucher(){
				uni.navigateTo({
					url:'../voucher/receive'
				})
			},
			gotoAgreement(){
				uni.navigateTo({
					url:'./agreement/agreement'
				})
			}
		}
	}
</script>

<style>

</style>
